/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#include "MkSipDialog.h"

CMkSipDialog::CMkSipDialog()
{

}

void CMkSipDialog::SetRequest(const CMkSipMessage& SipRequest)
{
    m_Request = SipRequest;
    if (MkSipDialogCallee == m_CallType
        && !m_Request.GetVecContact().empty()) {
        m_ContactHost = m_Request.GetVecContact().begin()->GetUri().GetHost();
        m_ContactPort = m_Request.GetVecContact().begin()->GetUri().GetPort();
    }
}

void CMkSipDialog::SetResponse(const CMkSipMessage& SipResponse)
{
    m_Response = SipResponse;
    if (MkSipDialogCaller == m_CallType
        && !m_Response.GetVecContact().empty()) {
        m_ContactHost = m_Response.GetVecContact().begin()->GetUri().GetHost();
        m_ContactPort = m_Response.GetVecContact().begin()->GetUri().GetPort();
    }
}

CMkSipDialog::~CMkSipDialog()
{

}